
"""
获取字典中层级属性值,多层会使用 "." 进行分割,类似springboot中的yaml配置获取方法
"""
def get(dict,propName,defaultValue=None):
    dictTemp=dict
    for s in propName.split("."):
        if s in dictTemp.keys():
            dictTemp=dictTemp[s]
            if dictTemp is None:
                break;
            elif not (type(dictTemp).__name__ == 'dict'):
               break;
        else:
            if defaultValue is None:
                dictTemp=None
            else:
                dictTemp=defaultValue
            break

    if dictTemp is None:
        if defaultValue is None:
            return dictTemp
        else:
            return defaultValue
    return dictTemp
